﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MyWeb.Business;

namespace MyWeb.Module.Slice
{
    public partial class Slice : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
                List<Data.Advertise> list = AdvertiseService.Advertise_GetByPosition("5");
                if (list.Count > 0)
                {
                    ltrslice.Text += "<div id=\"slider_container_2\"> \n";
                    ltrslice.Text += "<div id=\"SliderName_2\" class=\"SliderName_2\"> \n";
                    for (int i = 0; i < list.Count; i++)
                    {
                        ltrslice.Text += "<a href=\"" + list[i].Link + "\" target=\"_blank\" > <img src=\"" + list[i].Image + "\" width=\"980\" height=\"244\" /></a> \n";
                        ltrslice.Text += "<div class=\"SliderName_2Description\">" + list[i].Name + "<strong></strong></div> \n";

                    }
                    ltrslice.Text += "</div>";
                    ltrslice.Text += "<div id=\"SliderNameNavigation_2\"> \n";
                    ltrslice.Text += "</div> \n";
                    ltrslice.Text += "</div> \n";
                }
            //}
        }
        
    }
}